package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name="sys_assets")
@NamedQuery(name="SysAssets.findAll", query="SELECT s FROM SysAssets s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysAssets implements Serializable{
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    private BigInteger id;
    
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="user_id")
    private User userId;
	
    /** 商品数量 */
	@Column(name="shopping_num")
    private Long shoppingNum;
	
    /** 偷来的数量 */
	@Column(name="steal_num")
    private Long stealNum;
	
    /** 种植的数量 */
	@Column(name="plant_num")
    private Long plantNum;
	
    /** 成品数量 */
	@Column(name="finished_num")
    private Long finishedNum;
	
    /**  */
	@Column(name="shopping_type")
    private BigInteger shoppingType;
	
    /** 购买种子时间 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="pay_time")
    private Date payTime;
	
    /** 种植时间 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="plant_time")
    private Date plantTime;
	
    /** 成熟时间 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="finished_time")
    private Date finishedTime;
	
    /** 产品名称 */
	@Column(name="shopping_name")
    private String shoppingName;
	
    /** 产品图片 */
	@Column(name="shopping_img")
    private String shoppingImg;

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public User getUserId() {
		return userId;
	}

	public void setUserId(User userId) {
		this.userId = userId;
	}

	public Long getShoppingNum() {
		return shoppingNum;
	}

	public void setShoppingNum(Long shoppingNum) {
		this.shoppingNum = shoppingNum;
	}

	public Long getStealNum() {
		return stealNum;
	}

	public void setStealNum(Long stealNum) {
		this.stealNum = stealNum;
	}

	public Long getPlantNum() {
		return plantNum;
	}

	public void setPlantNum(Long plantNum) {
		this.plantNum = plantNum;
	}

	public Long getFinishedNum() {
		return finishedNum;
	}

	public void setFinishedNum(Long finishedNum) {
		this.finishedNum = finishedNum;
	}

	public BigInteger getShoppingType() {
		return shoppingType;
	}

	public void setShoppingType(BigInteger shoppingType) {
		this.shoppingType = shoppingType;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public Date getPlantTime() {
		return plantTime;
	}

	public void setPlantTime(Date plantTime) {
		this.plantTime = plantTime;
	}

	public Date getFinishedTime() {
		return finishedTime;
	}

	public void setFinishedTime(Date finishedTime) {
		this.finishedTime = finishedTime;
	}

	public String getShoppingName() {
		return shoppingName;
	}

	public void setShoppingName(String shoppingName) {
		this.shoppingName = shoppingName;
	}

	public String getShoppingImg() {
		return shoppingImg;
	}

	public void setShoppingImg(String shoppingImg) {
		this.shoppingImg = shoppingImg;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
}
